package cn.huiyunche.base.service.vo;

import com.alibaba.fastjson.JSONObject;

/**
 * 微信返回结果
 *
 * @author hdy [Tuffy]
 */
public class WeixinResultVo {

    private int errcode;
    private String errmsg;
    private boolean success;

    @SuppressWarnings("unused")
    private WeixinResultVo() {
    }

    public WeixinResultVo(JSONObject result) {
        if (null != result) {
            this.errcode = result.getIntValue("errcode");
            this.errmsg = result.getString("errmsg");
            this.success = this.errmsg.toLowerCase().equals("ok");
        }
    }

    public int getErrcode() {
        return errcode;
    }

    public String getErrmsg() {
        return errmsg;
    }

    public boolean isSuccess() {
        return success;
    }
}
